
export const toHighLightHtml = (word: string,key:string,color:string): string => {
    if(key === ''){
        return word
    }
    const regex = new RegExp(key, 'gi'); // 'gi' 表示忽略大小写，并全局搜索
    return  word.replace(regex,`<span style="color: ${color}">${key}</span>`)

}

export const strInStr = (word: string,key:string): boolean =>{
    return word.indexOf(key) >= 0
}